﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Netium.Compiler.TypeSystem
{
    public class DataType : IDataType
    {
        internal DataType(string typeName) // Used for create the primitive type internally
        {
            Form = DataTypeForm.Primitive;
            BaseType = null;
            SymbolTable = null;
            TypeName = typeName;
        }

        public DataType(DataTypeForm form, IDataType baseType, SymbolTable symTable)
        {
            Form = form;
            BaseType = baseType;

        }

        public DataTypeForm Form
        {
            get;
            private set;
        }

        public IDataType BaseType
        {
            get;
            private set;
        }

        public ISymbolTable SymbolTable
        {
            get;
            private set;
        }

        public string TypeName
        {
            get;
            private set;
        }
    }

    public static class PrimitiveDataTypes
    {
        public static readonly IDataType IntType = new DataType("int");
        public static readonly IDataType CharType = new DataType("char");
        public static readonly IDataType ShortType = new DataType("short");
        public static readonly IDataType LongType = new DataType("long");
        public static readonly IDataType FloatType = new DataType("float");
        public static readonly IDataType DoubleType = new DataType("double");
        public static readonly IDataType VoidType = new DataType("void");
    }
}
